function R = C_Setup_VarGapMouse1
  
global CG;

% Platforms are defined from their back to their front (e.g. w.r.t. Sensorlocations)
CG.Parameters.Setup.PlatformID = 1;
CG.Parameters.Setup.CameraID = 2;
CG.Parameters.Setup.DAQID = 1;

CG.Parameters.Setup.DAQ = struct(...
  'Device',{{'NI','Dev1'}},...
  'TrialChannel','port0/line0');

CG.Parameters.Setup.Audio = struct(...
  'Device',{{'NI','Dev2'}},...
  'TriggerChannel','PFI1',...
  'SRAI',500000,...
  'ChAI',{{'ai0','ai1'}});

CG.Parameters.Setup.Platforms = struct(...  
  'Location',{'left','right'},...
  'Device',{{'NI','Dev1'},{'NI','Dev1'}},...
  'SampleRate',10000,...
  'AnimalSensors',{{'ai0','ai1','ai2'},{'ai4','ai5','ai6'}},...
  'AnimalSensorThresholds',{[1,1.2,1.5],[1,1,1]},...
  'PositionSensors',{{'ai3'},{'ai7'}},...
  'PositionSensorThresholds',{[0.7],[0.6]},...
  'Position',{0,0},...
  'RangeMax',{50,50},...
  'PositionOffset',{7.5,7.5},... 
  'MotorMM2Step',{200,200},... 
  'GateCloseAngle',{180,0},... 
  'GateOpenAngle',{0,180},... 
  'GateVelocity',{6,5},...
  'GateState',{'open','open'},...
  'StepSize',{0.5,0.5},...
  'MotorID',{1,2},...
  'TimePerMM',{1.2,1.2},...
  'WaitTime',{0.7,0.7},...
  'StepTime',{0.1,0.1});

CG.Parameters.Setup.Camera = struct(...
  'Location','top',...
  'FrameRate',480,...
  'PulseLength',0.0003,... % DURATION OF TRIGGER PULSE IN SECONDS
  'Device',{{'NI','Dev1'}},...
  'PositionSensors',{{'ai9'}},...
  'PositionSensorThresholds',0.6,...
  'Position',0,'RangeMax',115,...
  'DistanceToCenter',54,... 
  'DistanceToPlatform',21,...
  'CameraID',1,...
  'MotorMM2Step',16,... 
  'MotorID',1,...
  'TimePerMM',0.12,... 
  'CameraChannel','port0/line1',...
  'TriggerChannel','PFI0',...
  'TriggerPeriod',0,...
  'PulseVoltage',5,...
  'WaitTime',0.15,...
  'StepSize',1,...
  'StepTime',0.15); % in us
